package com.maiworld.api.controller;

import java.util.Map;

import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.dubbo.config.annotation.Reference;
import com.maiworld.seller.service.CoinService;

@RestController
@RequestMapping("/coin")
public class CoinController {

	@Reference
	private CoinService coinService;
	
	//用户的金币详情 id:用户的id(测试通过)
	@RequestMapping("/findAll")
	public Map<String, Object> findAll(String openid, Long sid,String status,String session_key){
		return coinService.findAll(openid,sid);
	}
	
	//获得/消费--金币详情(测试通过)
	@RequestMapping(value = "/add",method=RequestMethod.POST)
	public Map<String, Object> add(
			@RequestBody Map<String, String> parmes
			){
		System.out.print(parmes);
		return coinService.add(parmes);
	}
	
}
